﻿using Gp.GameLogic;
using UnityEngine;

namespace Gp.Scripts.Core {
    public class BagAttachment : MonoBehaviour{
        [SerializeField] private Light bagLight;
        public Light BagLight => bagLight;
        [SerializeField] private InteractableItem interactableItem;

        private void Start() {
            bagLight.enabled = false;
            // interactableItem.AddInfoEntry(new InteractEntryInfo(() => "捡回", OnPickup));
            interactableItem.enabled = false;
        }

        public void OnDrop() {
            interactableItem.enabled = true;
        }
        
        
        private void OnPickup() {
            // bagLight.enabled = false;
            // // 将背包捡回
            // interactableItem.enabled = false;
            // if (!ObjectHelper.PlayerCharacter.TryGetComponent<PlayerHumanoidUnit>(out var unit)) return;
            // transform.SetParent(unit.BagPivot);
            // transform.LocalPositionIdentity();
            // transform.LocalRotationIdentity();
        }
    }
}